package com.easy.activiti.ext;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhouchuang
 * 2024-11-05 10:29:59
 */
public interface IActivitiListener {

    /**
     * 流程启动
     * @param taskEvent
     */
    default void processStarted(TaskEvent taskEvent){
        System.out.println("processStarted called:"+taskEvent.getBusinessKey());
    }
    /**
     * 初始化启动变量
     */
    default Map<String,Object> startVariables(String businessKey){
        System.out.println("startVariables");
        return new HashMap<>();
    }
    /**
     * 审批拒绝
     * @param taskEvent
     */
    default void reject(TaskEvent taskEvent){
        System.out.println("reject called:"+taskEvent.getBusinessKey());
    }
    /**
     * 任务创建，可以分配人员
     * @param taskEvent
     */
    default void created(TaskEvent taskEvent){
        System.out.println("created called:"+taskEvent.getBusinessKey());
    }
    /**
     * 任务完成
     * @param taskEvent
     */
    default void complete(TaskEvent taskEvent){
        System.out.println("complete called:"+taskEvent.getBusinessKey());
    }
    /**
     * 任务分配
     * @param taskEvent
     */
    default void assigned(TaskEvent taskEvent){
        System.out.println("assigned called:"+taskEvent.getBusinessKey());
    }
    /**
     * 流程结束，审批通过
     * @param taskEvent
     */
    default void processComplete(TaskEvent taskEvent){
        System.out.println("processComplete called:"+taskEvent.getBusinessKey());
    }
}
